import server from "./services/server";

export default {
  async fetchHouses({ state }) {
    if (!state.houses.length) {
      const { data } = await server.getAllHouses();
      state.houses = data;
    }
  },
  async fetchCharacters({ state }, { p, c }) {
    if (!state.characters.length) {
      const { data } = await server.getAllCharacters(p, c);
      state.characters = data;
    }
  }
};
